package cn.zust.edu.cn;

import java.awt.*;

public class Triangle implements IShape{
    java.awt.Point ptA,ptB,ptC;
    private double edgeA,edgeB,edgeC;
    private Graphics graphics;

    Triangle(Point ptA, Point ptB, Point ptC){

    }

    public double perimeter() {
        return edgeA + edgeB +edgeC;
    }

    public double area() {
        double p = (edgeA + edgeB + edgeC) / 2;
        return Math.sqrt(p * (p - edgeA) * (p - edgeB) * (p - edgeC));
    }

    public void draw() {
        graphics.drawLine(ptA.x, ptA.y, ptB.x, ptB.y);
        graphics.drawLine(ptA.x, ptA.y, ptC.x, ptC.y);
        graphics.drawLine(ptC.x, ptC.y, ptB.x, ptB.y);
    }
}
